WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
rotations.h
Go to the documentation of this file.
1// WOLF - Copyright (C) 2020-2026
2// Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
3// Authors: Joan Solà Ortega (jsola@iri.upc.edu) and
4// Joan Vallvé Navarro (jvallve@iri.upc.edu)
5// All rights reserved.
6//
7// This file is part of WOLF: http://www.iri.upc.edu/wolf
8// WOLF is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License version 3
10// as published by the Free Software Foundation.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19#pragma once
20
21#include "core/common/wolf.h"
22
23namespace wolf
24{
26
33template <typename T>
34inline T pi2pi(const T& _angle)
35{
36 return remainder(_angle, 2 * M_PI);
37}
38
44template <typename T>
45inline T toRad(const T deg)
46{
47 return (T)M_TORAD * deg;
48}
49
55template <typename T>
56inline T toDeg(const T rad)
57{
58 return (T)M_TODEG * rad;
59}
60
62// Operators skew and vee
63
69template <typename Derived>
70inline Eigen::Matrix<typename Derived::Scalar, 3, 3> skew(const Eigen::MatrixBase<Derived>& _v)
71{
73
74 typedef typename Derived::Scalar T;
75
76 Eigen::Matrix<T, 3, 3> sk;
77
78 sk << (T)0.0, -_v(2), +_v(1), +_v(2), (T)0.0, -_v(0), -_v(1), +_v(0), (T)0.0;
79
80 return sk;
81}
82
88template <typename Derived>
89inline Eigen::Matrix<typename Derived::Scalar, 3, 1> vee(const Eigen::MatrixBase<Derived>& _m)
90{
92
93 typedef typename Derived::Scalar T;
94
95 return (Eigen::Matrix<T, 3, 1>() << _m(2, 1), _m(0, 2), _m(1, 0)).finished();
96}
97
99// Rotation conversions q, R, Euler, back and forth
100//
101// Euler angles are denoted 'e' and are in the ZYX convention
102
108template <typename Derived>
109inline Eigen::Matrix<typename Derived::Scalar, 3, 3> q2R(const Eigen::QuaternionBase<Derived>& _q)
110{
111 return _q.matrix();
112}
113
119template <typename Derived>
120inline Eigen::Matrix<typename Derived::Scalar, 3, 3> q2R(const Eigen::MatrixBase<Derived>& _q)
121{
123 Eigen::Quaternion<typename Derived::Scalar> q(_q(3), _q(0), _q(1), _q(2));
124 return q2R(q);
125}
126
132template <typename Derived>
133inline Eigen::Quaternion<typename Derived::Scalar> R2q(const Eigen::MatrixBase<Derived>& _R)
134{
136
137 return Eigen::Quaternion<typename Derived::Scalar>(_R);
138}
139
144template <typename D>
145inline Eigen::Quaternion<typename D::Scalar> e2q(const Eigen::MatrixBase<D>& _euler)
146{
148
149 typedef typename D::Scalar T;
150
151 const Eigen::AngleAxis<T> ax = Eigen::AngleAxis<T>(_euler(0), Eigen::Matrix<T, 3, 1>::UnitX());
152 const Eigen::AngleAxis<T> ay = Eigen::AngleAxis<T>(_euler(1), Eigen::Matrix<T, 3, 1>::UnitY());
153 const Eigen::AngleAxis<T> az = Eigen::AngleAxis<T>(_euler(2), Eigen::Matrix<T, 3, 1>::UnitZ());
154
155 return Eigen::Quaternion<T>(az * ay * ax);
156}
157
162template <typename Derived>
163inline Eigen::Matrix<typename Derived::Scalar, 3, 3> e2R(const Eigen::MatrixBase<Derived>& _e)
164{
166
167 return e2q(_e).matrix();
168}
169
170template <typename Derived>
171inline typename Eigen::Matrix<typename Derived::Scalar, 3, 1> R2e(const Eigen::MatrixBase<Derived>& _R)
172{
173 Eigen::Matrix<typename Derived::Scalar, 3, 1> e;
174
175 e(0) = atan2(_R(2, 1), _R(2, 2));
176 e(1) = atan2(-_R(2, 0), sqrt(_R(0, 0) * _R(0, 0) + _R(1, 0) * _R(1, 0)));
177 e(2) = atan2(_R(1, 0), _R(0, 0));
178
179 return e;
180}
181
182template <typename Derived>
183inline typename Eigen::Matrix<typename Derived::Scalar, 3, 1> q2e(const Eigen::MatrixBase<Derived>& _q)
184{
185 typedef typename Derived::Scalar T;
186 Eigen::Matrix<T, 3, 1> e;
187
188 const double& w = _q(3);
189 const double& x = _q(0);
190 const double& y = _q(1);
191 const double& z = _q(2);
192
193 double xx = x * x;
194 double xy = x * y;
195 double xz = x * z;
196 double yy = y * y;
197 double yz = y * z;
198 double zz = z * z;
199 double wx = w * x;
200 double wy = w * y;
201 double wz = w * z;
202
203 double r00 = T(1) - T(2) * (yy + zz);
204 double r10 = T(2) * (xy + wz);
205 double r20 = T(2) * (xz - wy);
206 double r21 = T(2) * (yz + wx);
207 double r22 = T(1) - T(2) * (xx + yy);
208
209 e(0) = atan2(r21, r22);
210 e(1) = atan2(-r20, sqrt(r00 * r00 + r10 * r10));
211 e(2) = atan2(r10, r00);
212
213 return e;
214}
215
216template <typename Derived>
217inline typename Eigen::Matrix<typename Derived::Scalar, 3, 1> q2e(const Eigen::QuaternionBase<Derived>& _q)
218{
219 return q2e(_q.coeffs());
220}
221
222template <typename Derived>
223inline typename Eigen::MatrixBase<Derived>::Scalar getYaw(const Eigen::MatrixBase<Derived>& _M)
224{
225 // Rotation matrix case
226 if (_M.rows() == 3 and _M.cols() == 3) return std::atan2(_M(1, 0), _M(0, 0));
227
228 // quaternion case
229 if (_M.rows() == 4 and _M.cols() == 1)
230 {
231 typedef typename Derived::Scalar T;
232 const double& w = _M(3, 0);
233 const double& x = _M(0, 0);
234 const double& y = _M(1, 0);
235 const double& z = _M(2, 0);
236 return atan2(T(2) * (x * y + w * z), T(1) - T(2) * (y * y + z * z));
237 }
238 // wrong input size
239 else
240 assert(false && "getYaw wrong input size. Should be 3x3 matrix (rotation matrix) or 4d vector (quaternion).");
241}
242
243template <typename Derived>
244inline typename Eigen::QuaternionBase<Derived>::Scalar getYaw(const Eigen::QuaternionBase<Derived>& _q)
245{
246 return getYaw(_q.coeffs());
247}
248
250// Rotation conversions - exp and log maps
251
257template <typename Derived>
258inline Eigen::Quaternion<typename Derived::Scalar> exp_q(const Eigen::MatrixBase<Derived>& _v)
259{
260 using std::cos;
261 using std::sin;
262 using std::sqrt;
263
265
266 typedef typename Derived::Scalar T;
267
268 T angle_squared = _v.squaredNorm();
269 T angle = sqrt(angle_squared); // Allow autodiff::Jet to use its own sqrt() version.
270
271 if (angle > (T)(wolf::Constants::EPS_SMALL))
272 {
273 return Eigen::Quaternion<T>(Eigen::AngleAxis<T>(angle, _v.normalized()));
274 }
275 else
276 {
277 return Eigen::Quaternion<T>((T)1.0, _v(0, 0) / (T)2, _v(1, 0) / (T)2, _v(2, 0) / (T)2);
278 }
279}
280
286template <typename Derived>
287inline Eigen::Matrix<typename Derived::Scalar, 3, 1> log_q(const Eigen::QuaternionBase<Derived>& _q)
288{
289 // Will try this implementation once Eigen accepts it!
290 // see https://forum.kde.org/viewtopic.php?f=74&t=143269&p=385299#p385265
291 // typedef typename Derived::Scalar T;
292 // Eigen::AngleAxis<T> aa(_q);
293 // return aa.angle() * aa.axis();
294
295 // In the meanwhile, we have a custom implementation as follows
296
297 typedef typename Derived::Scalar T;
298
299 Eigen::Matrix<T, 3, 1> vec = _q.vec();
300 const T sin_angle_squared = vec.squaredNorm();
301 if (sin_angle_squared > (T)wolf::Constants::EPS_SMALL)
302 {
303 const T sin_angle = sqrt(sin_angle_squared); // Allow autodiff::Jet to use its own sqrt() version.
304 const T& cos_angle = _q.w();
305
306 /* If (cos_angle < 0) then angle >= pi/2 , means : angle for angle_axis vector >= pi (== 2*angle)
307 |-> results in correct rotation but not a normalized angle_axis vector
308
309 In that case we observe that 2 * angle ~ 2 * angle - 2 * pi,
310 which is equivalent saying
311
312 angle - pi = atan(sin(angle - pi), cos(angle - pi))
313 = atan(-sin(angle), -cos(angle))
314 */
315 const T two_angle =
316 T(2.0) * ((cos_angle < T(0.0)) ? atan2(-sin_angle, -cos_angle) : atan2(sin_angle, cos_angle));
317 const T k = two_angle / sin_angle;
318 return vec * k;
319 }
320 else
321 {
322 // small-angle approximation
323 return vec * (T)2.0;
324 }
325}
326
332template <typename Derived>
333inline Eigen::Matrix<typename Derived::Scalar, 3, 3> exp_R(const Eigen::MatrixBase<Derived>& _v)
334{
335 using std::sqrt;
336
338
339 typedef typename Derived::Scalar T;
340
341 T angle_squared = _v.squaredNorm();
342 T angle = sqrt(angle_squared); // Allow autodiff::Jet to use its own sqrt() version.
343
344 if (angle > wolf::Constants::EPS_SMALL)
345 return Eigen::AngleAxis<T>(angle, _v.normalized()).toRotationMatrix();
346 else
347 return Eigen::Matrix<T, 3, 3>::Identity() + skew(_v);
348}
349
355template <typename Derived>
356inline Eigen::Matrix<typename Derived::Scalar, 3, 1> log_R(const Eigen::MatrixBase<Derived>& _R)
357{
358 return log_q(R2q(_R));
359}
360
366template <typename Derived>
367inline Eigen::Quaternion<typename Derived::Scalar> v2q(const Eigen::MatrixBase<Derived>& _v)
368{
369 return exp_q(_v);
370}
371
377template <typename Derived>
378inline Eigen::Matrix<typename Derived::Scalar, 3, 1> q2v(const Eigen::QuaternionBase<Derived>& _q)
379{
380 return log_q(_q);
381}
382
388template <typename Derived>
389inline Eigen::Matrix<typename Derived::Scalar, 3, 3> v2R(const Eigen::MatrixBase<Derived>& _v)
390{
391 return exp_R(_v);
392}
393
399template <typename Derived>
400inline Eigen::Matrix<typename Derived::Scalar, 3, 1> R2v(const Eigen::MatrixBase<Derived>& _R)
401{
402 return log_R(_R);
403}
404
406// Jacobians of SO(3)
407
422template <typename Derived>
423inline Eigen::Matrix<typename Derived::Scalar, 3, 3> jac_SO3_right(const Eigen::MatrixBase<Derived>& _theta)
424{
425 using std::cos;
426 using std::sin;
427 using std::sqrt;
428
430
431 typedef typename Derived::Scalar T;
432
433 T theta2 = _theta.squaredNorm();
434 Eigen::Matrix<T, 3, 3> W(skew(_theta));
435 if (theta2 <= Constants::EPS_SMALL)
436 return Eigen::Matrix<T, 3, 3>::Identity() - (T)0.5 * W; // Small angle approximation
437 T theta = sqrt(theta2); // rotation angle
438 Eigen::Matrix<T, 3, 3> M1, M2;
439 M1.noalias() = ((T)1 - cos(theta)) / theta2 * W;
440 M2.noalias() = (theta - sin(theta)) / (theta2 * theta) * (W * W);
441 return Eigen::Matrix<T, 3, 3>::Identity() - M1 + M2;
442}
443
462template <typename Derived>
463inline Eigen::Matrix<typename Derived::Scalar, 3, 3> jac_SO3_right_inv(const Eigen::MatrixBase<Derived>& _theta)
464{
465 using std::cos;
466 using std::sin;
467 using std::sqrt;
468
470
471 typedef typename Derived::Scalar T;
472
473 T theta2 = _theta.squaredNorm();
474 Eigen::Matrix<T, 3, 3> W(skew(_theta));
475 if (theta2 <= Constants::EPS_SMALL)
476 return Eigen::Matrix<T, 3, 3>::Identity() + (T)0.5 * W; // Small angle approximation
477 T theta = sqrt(theta2); // rotation angle
478 Eigen::Matrix<T, 3, 3> M;
479 M.noalias() = ((T)1.0 / theta2 - ((T)1.0 + cos(theta)) / ((T)2.0 * theta * sin(theta))) * (W * W);
480 return Eigen::Matrix<T, 3, 3>::Identity() + (T)0.5 * W + M; // is this really more optimized?
481}
482
496template <typename Derived>
497inline Eigen::Matrix<typename Derived::Scalar, 3, 3> jac_SO3_left(const Eigen::MatrixBase<Derived>& _theta)
498{
499 using std::cos;
500 using std::sin;
501 using std::sqrt;
502
504
505 typedef typename Derived::Scalar T;
506
507 T theta2 = _theta.squaredNorm();
508 Eigen::Matrix<T, 3, 3> W(skew(_theta));
509 if (theta2 <= Constants::EPS_SMALL)
510 return Eigen::Matrix<T, 3, 3>::Identity() - (T)0.5 * W; // Small angle approximation
511 T theta = sqrt(theta2); // rotation angle
512 Eigen::Matrix<T, 3, 3> M1, M2;
513 M1.noalias() = ((T)1 - cos(theta)) / theta2 * W;
514 M2.noalias() = (theta - sin(theta)) / (theta2 * theta) * (W * W);
515 return Eigen::Matrix<T, 3, 3>::Identity() + M1 + M2;
516}
517
535template <typename Derived>
536inline Eigen::Matrix<typename Derived::Scalar, 3, 3> jac_SO3_left_inv(const Eigen::MatrixBase<Derived>& _theta)
537{
538 using std::cos;
539 using std::sin;
540 using std::sqrt;
541
543
544 typedef typename Derived::Scalar T;
545
546 T theta2 = _theta.squaredNorm();
547 Eigen::Matrix<T, 3, 3> W(skew(_theta));
548 if (theta2 <= Constants::EPS_SMALL)
549 return Eigen::Matrix<T, 3, 3>::Identity() + (T)0.5 * W; // Small angle approximation
550 T theta = sqrt(theta2); // rotation angle
551 Eigen::Matrix<T, 3, 3> M;
552 M.noalias() = ((T)1.0 / theta2 - ((T)1.0 + cos(theta)) / ((T)2.0 * theta * sin(theta))) * (W * W);
553 return Eigen::Matrix<T, 3, 3>::Identity() - (T)0.5 * W + M; // is this really more optimized?
554}
555
556template <typename D1, typename D2, typename D3, typename D4, typename D5>
557inline void compose(const Eigen::QuaternionBase<D1>& _q1,
558 const Eigen::QuaternionBase<D2>& _q2,
559 Eigen::QuaternionBase<D3>& _q_comp,
560 Eigen::MatrixBase<D4>& _J_comp_q1,
561 Eigen::MatrixBase<D5>& _J_comp_q2)
562{
565
566 _q_comp = _q1 * _q2;
567
568 _J_comp_q1 = q2R(_q2.conjugate()); // R2.tr
569 _J_comp_q2.setIdentity();
570}
571
572template <typename D1, typename D2, typename D3, typename D4, typename D5>
573inline void between(const Eigen::QuaternionBase<D1>& _q1,
574 const Eigen::QuaternionBase<D2>& _q2,
575 Eigen::QuaternionBase<D3>& _q_between,
576 Eigen::MatrixBase<D4>& _J_between_q1,
577 Eigen::MatrixBase<D5>& _J_between_q2)
578{
579 MatrixSizeCheck<3, 3>::check(_J_between_q1);
580 MatrixSizeCheck<3, 3>::check(_J_between_q2);
581
582 _q_between = _q1.conjugate() * _q2;
583
584 _J_between_q1 = -q2R(_q2.conjugate() * _q1); // - R2.tr * R1
585 _J_between_q2.setIdentity();
586}
587
588template <typename D1, typename D2>
589inline Eigen::Quaternion<typename D1::Scalar> plus_right(const Eigen::QuaternionBase<D1>& q,
590 const Eigen::MatrixBase<D2>& v)
591{
593 return q * exp_q(v);
594}
595
596template <typename D1, typename D2>
597inline Eigen::Matrix<typename D2::Scalar, 3, 1> minus_right(const Eigen::QuaternionBase<D1>& q1,
598 const Eigen::QuaternionBase<D2>& q2)
599{
600 return log_q(q1.conjugate() * q2);
601}
602
603template <typename D1, typename D2>
604inline Eigen::Quaternion<typename D1::Scalar> plus_left(const Eigen::MatrixBase<D2>& v,
605 const Eigen::QuaternionBase<D1>& q)
606{
608 return exp_q(v) * q;
609}
610
611template <typename D1, typename D2>
612inline Eigen::Matrix<typename D2::Scalar, 3, 1> minus_left(const Eigen::QuaternionBase<D1>& q1,
613 const Eigen::QuaternionBase<D2>& q2)
614{
615 return log_q(q2 * q1.conjugate());
616}
617
618template <typename D1, typename D2>
619inline Eigen::Quaternion<typename D1::Scalar> plus(const Eigen::QuaternionBase<D1>& q, const Eigen::MatrixBase<D2>& v)
620{
621 return plus_right(q, v);
622}
623
624template <typename D1, typename D2>
625inline Eigen::Matrix<typename D2::Scalar, 3, 1> minus(const Eigen::QuaternionBase<D1>& q1,
626 const Eigen::QuaternionBase<D2>& q2)
627{
628 return minus_right(q1, q2);
629}
630
631template <typename D1, typename D2>
632inline Eigen::Matrix<typename D2::Scalar, 3, 1> diff(const Eigen::QuaternionBase<D1>& q1,
633 const Eigen::QuaternionBase<D2>& q2)
634{
635 return minus(q1, q2);
636}
637
638} // namespace wolf
const double EPS_SMALL
Definition: wolf.h:76
Jet< double, N > remainder(const Jet< double, N > &_x, long double _y)
Definition: wolf_jet.h:31
Jet< T, N > sin(const Jet< T, N > &f)
Definition: jet.h:641
Jet< T, N > atan2(const Jet< T, N > &g, const Jet< T, N > &f)
Definition: jet.h:1167
Jet< T, N > sqrt(const Jet< T, N > &f)
Definition: jet.h:617
Jet< T, N > cos(const Jet< T, N > &f)
Definition: jet.h:626
Definition: capture_base.h:23
Eigen::Matrix< typename Derived::Scalar, 3, 3 > q2R(const Eigen::QuaternionBase< Derived > &_q)
quaternion to rotation matrix conversion
Definition: rotations.h:109
Eigen::Matrix< typename Derived::Scalar, 3, 1 > q2e(const Eigen::MatrixBase< Derived > &_q)
Definition: rotations.h:183
Eigen::Matrix< typename D2::Scalar, 3, 1 > minus(const Eigen::QuaternionBase< D1 > &q1, const Eigen::QuaternionBase< D2 > &q2)
Definition: rotations.h:625
Eigen::Quaternion< typename Derived::Scalar > v2q(const Eigen::MatrixBase< Derived > &_v)
Rotation vector to quaternion conversion.
Definition: rotations.h:367
Eigen::Matrix< typename Derived::Scalar, 3, 3 > jac_SO3_right_inv(const Eigen::MatrixBase< Derived > &_theta)
Compute Jrinv (inverse of Right Jacobian which corresponds to the jacobian of log) Right Jacobian for...
Definition: rotations.h:463
T pi2pi(const T &_angle)
Return angle between -pi and pi This implementation uses std::remainder which makes it incompatible f...
Definition: rotations.h:34
Eigen::Matrix< typename Derived::Scalar, 3, 1 > R2e(const Eigen::MatrixBase< Derived > &_R)
Definition: rotations.h:171
Eigen::Quaternion< typename Derived::Scalar > exp_q(const Eigen::MatrixBase< Derived > &_v)
Quaternion exponential map.
Definition: rotations.h:258
Eigen::Matrix< typename Derived::Scalar, 3, 3 > jac_SO3_left(const Eigen::MatrixBase< Derived > &_theta)
Compute Jl (Left Jacobian) Left Jacobian for exp map in SO(3) - equation (10.86) and following equati...
Definition: rotations.h:497
Eigen::Matrix< typename D2::Scalar, 3, 1 > minus_left(const Eigen::QuaternionBase< D1 > &q1, const Eigen::QuaternionBase< D2 > &q2)
Definition: rotations.h:612
Eigen::Matrix< typename D2::Scalar, 3, 1 > diff(const Eigen::QuaternionBase< D1 > &q1, const Eigen::QuaternionBase< D2 > &q2)
Definition: rotations.h:632
T toDeg(const T rad)
Conversion to degrees.
Definition: rotations.h:56
Eigen::Quaternion< typename D1::Scalar > plus_right(const Eigen::QuaternionBase< D1 > &q, const Eigen::MatrixBase< D2 > &v)
Definition: rotations.h:589
Eigen::Matrix< typename Derived::Scalar, 3, 3 > v2R(const Eigen::MatrixBase< Derived > &_v)
Rotation vector to rotation matrix conversion.
Definition: rotations.h:389
Eigen::Matrix< typename Derived::Scalar, 3, 1 > q2v(const Eigen::QuaternionBase< Derived > &_q)
Quaternion to rotation vector conversion.
Definition: rotations.h:378
Eigen::Matrix< typename Derived::Scalar, 3, 3 > jac_SO3_right(const Eigen::MatrixBase< Derived > &_theta)
Compute Jr (Right Jacobian) Right Jacobian for exp map in SO(3) - equation (10.86) and following equa...
Definition: rotations.h:423
Eigen::Matrix< typename Derived::Scalar, 3, 3 > exp_R(const Eigen::MatrixBase< Derived > &_v)
Rotation matrix exponential map.
Definition: rotations.h:333
Eigen::Matrix< typename D2::Scalar, 3, 1 > minus_right(const Eigen::QuaternionBase< D1 > &q1, const Eigen::QuaternionBase< D2 > &q2)
Definition: rotations.h:597
Eigen::Matrix< typename Derived::Scalar, 3, 1 > log_q(const Eigen::QuaternionBase< Derived > &_q)
Quaternion logarithmic map.
Definition: rotations.h:287
Eigen::Quaternion< typename D::Scalar > e2q(const Eigen::MatrixBase< D > &_euler)
Euler angles to quaternion.
Definition: rotations.h:145
T toRad(const T deg)
Conversion to radians.
Definition: rotations.h:45
Eigen::Matrix< typename Derived::Scalar, 3, 1 > R2v(const Eigen::MatrixBase< Derived > &_R)
Rotation matrix to rotation vector conversion.
Definition: rotations.h:400
Eigen::Matrix< typename Derived::Scalar, 3, 1 > log_R(const Eigen::MatrixBase< Derived > &_R)
Rotation matrix logarithmic map.
Definition: rotations.h:356
Eigen::Quaternion< typename Derived::Scalar > R2q(const Eigen::MatrixBase< Derived > &_R)
rotation matrix to quaternion conversion
Definition: rotations.h:133
Eigen::Quaternion< typename D1::Scalar > plus_left(const Eigen::MatrixBase< D2 > &v, const Eigen::QuaternionBase< D1 > &q)
Definition: rotations.h:604
Eigen::Matrix< typename Derived::Scalar, 3, 3 > jac_SO3_left_inv(const Eigen::MatrixBase< Derived > &_theta)
Compute Jl_inv (inverse of Left Jacobian which corresponds to the jacobian of log) Left Jacobian for ...
Definition: rotations.h:536
Eigen::Quaternion< typename D1::Scalar > plus(const Eigen::QuaternionBase< D1 > &q, const Eigen::MatrixBase< D2 > &v)
Definition: rotations.h:619
Eigen::Matrix< typename Derived::Scalar, 3, 1 > vee(const Eigen::MatrixBase< Derived > &_m)
Inverse of skew symmetric matrix.
Definition: rotations.h:89
Eigen::Matrix< typename Derived::Scalar, 3, 3 > e2R(const Eigen::MatrixBase< Derived > &_e)
Euler angles to rotation matrix.
Definition: rotations.h:163
void between(const Eigen::QuaternionBase< D1 > &_q1, const Eigen::QuaternionBase< D2 > &_q2, Eigen::QuaternionBase< D3 > &_q_between, Eigen::MatrixBase< D4 > &_J_between_q1, Eigen::MatrixBase< D5 > &_J_between_q2)
Definition: rotations.h:573
Eigen::Matrix< typename Derived::Scalar, 3, 3 > skew(const Eigen::MatrixBase< Derived > &_v)
Skew symmetric matrix.
Definition: rotations.h:70
Eigen::MatrixBase< Derived >::Scalar getYaw(const Eigen::MatrixBase< Derived > &_M)
Definition: rotations.h:223
void compose(const Eigen::QuaternionBase< D1 > &_q1, const Eigen::QuaternionBase< D2 > &_q2, Eigen::QuaternionBase< D3 > &_q_comp, Eigen::MatrixBase< D4 > &_J_comp_q1, Eigen::MatrixBase< D5 > &_J_comp_q2)
Definition: rotations.h:557
static void check(const T &t)
Assert matrix size dynamically or statically.
Definition: wolf.h:187
#define M_TORAD
Definition: wolf.h:68
#define M_TODEG
Definition: wolf.h:69